package com.estate.struts.actions;

import com.estate.business.IndexService;
import com.estate.struts.actionForms.IndexActionForm;

public class IndexAction extends EstateSupport {
	
	private IndexService indexService;

	@Override
	public String execute() throws Exception {
		String page = "";
		
		IndexActionForm iaf = this.getIndexService().getIndexForm(this.getSessionUser());
		this.getRequest().setAttribute("indexForm", iaf);
		
		boolean result = false;
		if(iaf != null){
			result = true;
			
		}
		if(result){
			page=this.SUCCESS;
		}else{
			page="fail";
		}
		return page;
	}

	public IndexService getIndexService() {
		return indexService;
	}

	public void setIndexService(IndexService indexService) {
		this.indexService = indexService;
	}
}
